package stu.officedrunker.applications.portfolio.controller;

import java.util.List;

import javax.servlet.ServletContext;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.MessageSourceAware;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import stu.officedrunker.applications.common.controller.BaseController;
import stu.officedrunker.applications.lucky.service.LuckyService;
import stu.officedrunker.applications.lucky.vo.LuckyRequestVO;
import stu.officedrunker.applications.portfolio.service.PortfolioService;

@Controller
@RequestMapping("/portfolio")
public class PortfolioController extends BaseController /* implements MessageSourceAware */ {
	
	private Logger log = LoggerFactory.getLogger(this.getClass());
	
	@Autowired
	private PortfolioService portfolioService;
	
	
	/**
	 * setPortfolio
	 * GET - setPortfolio : {context}/setPortfolio
	 * @param vo
	 * @return successYn
	 * @throws Exception
	 */
	@RequestMapping(method = RequestMethod.GET, value = "/setPortfolio")
	public ModelAndView getPortfolio (LuckyRequestVO luckyVO, Model model) throws Exception {
		ModelAndView mav = new ModelAndView();
		model.asMap().clear();
		mav.clear();
		
		// logging API name
		log.debug("/setPortfolio API Start");
		
		// service Logic
		portfolioService.setPortfolio(luckyVO);
		return success("resp", "");
	}
	
}